package com.colis.quartz.common.model;

import com.colis.quartz.module.sms.QuartzTask;
import lombok.Data;
import org.quartz.Job;

/**
 * <p> 描述：任务配置 </p>
 *
 * @author wlp
 * @version 1.0.0
 * @date 2022/1/14 11:41
 */
@Data
public class JobConfig extends QuartzTask {

    private Class<? extends Job> jobClass;

    public void build(QuartzTask quartzTask) {
        this.setParams(quartzTask.getParams())
                .setQuartzCron(quartzTask.getQuartzCron())
                .setQuartzName(quartzTask.getQuartzName())
                .setQuartzStatus(quartzTask.getQuartzStatus())
                .setQuartzType(quartzTask.getQuartzType())
                .setTargetBean(quartzTask.getTargetBean())
                .setTargetMethod(quartzTask.getTargetMethod())
                .setRemark(quartzTask.getRemark())
                .setTargetContent(quartzTask.getTargetContent())
                .setCreateTime(quartzTask.getCreateTime())
                .setModifyTime(quartzTask.getModifyTime())
                .setId(quartzTask.getId());
    }
}
